package com.tc.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@AllArgsConstructor
@Getter
public enum LoginTypeEnum {
    VERFICATION_CODE(0),
    PASSWORD_CODE(1)
    ;

    private Integer code;

    // 获取 可以直接get
    public static LoginTypeEnum valueOf(Integer code) {
        for (LoginTypeEnum loginTypeEnum : LoginTypeEnum.values()) {
            if (Objects.equals(code, loginTypeEnum.getCode())) {
                return loginTypeEnum;
            }
        }
        return null;
    }
}
